package list;

import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import org.junit.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author
 * @Title: TestArrayToList
 * @Description:
 * @date 2023/5/26 09:44
 */
public class TestArrayToList {

    @Test
    public void test01(){
        String[] s = {"1","2"};
        List<String> list = Arrays.asList(s);
        s[0] = "99";
        System.out.println(list); //list会随着数组的变化而变化
    }

    @Test
    public void test02(){
        String[] s = {"1","2"};
        List<String> list = new ArrayList<>(Arrays.asList(s));
        s[0] = "99";
        System.out.println(list);
    }
}
